package ${setDomainPackageName};

<#list modelColumn as model>
    <#if  model.modelAttrType='JSONObject'  >
import com.alibaba.fastjson.JSONObject;
import com.allen.app.common.utils.ClassUtil;
import com.allen.app.common.utils.Jackson;
import com.fasterxml.jackson.annotation.JsonIgnore;
        <#break>
    </#if>
</#list>
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
* Description:${tableAnnotation}
* @author ${author}
* @date ${date}
*/
@Getter
@Setter
@ToString
@ApiModel(description = "${tableAnnotation}")
<#--@NoArgsConstructor-->
<#--@EqualsAndHashCode-->
public class ${DOMAIN_CLASSNAME} {

<#if modelColumn?exists>
    <#list modelColumn as model>
    <#--/**
    *${model.columnComment!}
    */-->
    <#--@JsonProperty("${model.changeColumnName?uncap_first}")-->
    <#if  model.modelAttrType='Date' >
    @ApiModelProperty("${model.columnComment!}")
    private java.util.Date ${model.changeColumnName?uncap_first};
    <#elseif model.modelAttrType='BigDecimal'>
    @ApiModelProperty("${model.columnComment!}")
    private Double ${model.changeColumnName?uncap_first};
    <#elseif model.modelAttrType='INT UNSIGNED'>
    @ApiModelProperty("${model.columnComment!}")
    private Integer ${model.changeColumnName?uncap_first};
    <#elseif model.modelAttrType='JSONObject'>
    @ApiModelProperty("${model.columnComment!}")
    @JsonIgnore
    private String ${model.changeColumnName?uncap_first};

    @ApiModelProperty(notes="${model.columnComment!}",example = "{}")
    @JsonIgnore
    private JSONObject ${model.changeColumnName?uncap_first}Json;

    public JSONObject get${model.changeColumnName?cap_first }Json() {
        return Jackson.jsonObject(${model.changeColumnName?uncap_first});
    }

    public void set${model.changeColumnName?cap_first }Json(JSONObject ${model.changeColumnName?uncap_first}Json) {
        ClassUtil.buildEmptyStrToNull(${model.changeColumnName?uncap_first}Json);
        this.${model.changeColumnName?uncap_first}Json = ${model.changeColumnName?uncap_first}Json;
        this.${model.changeColumnName?uncap_first} = Jackson.json(${model.changeColumnName?uncap_first}Json);
    }
    <#else>
    @ApiModelProperty("${model.columnComment!?replace("\"","")}")
    private ${model.modelAttrType!} ${model.changeColumnName?uncap_first};
    </#if>

    </#list>
</#if>
}
